﻿using System.Linq;
using yiCommerce.Core;
using yiCommerce.Core.Data;
using yiCommerce.Core.Domain.Tags;

namespace yiCommerce.Service.Tags
{
    public class TagIntroService:ITagIntroService
    {
        //private IRepository<TagIntroStatuses> _tagIntroRep;

        //public TagIntroService(IRepository<TagIntroStatuses> tagIntroRep)
        //{
        //    _tagIntroRep = tagIntroRep;
        //}

        //public IPagedList<TagIntroStatuses> FindTagIntro(int pageIndex, int pageSize)
        //{
        //    var query = from c in _tagIntroRep.Table
        //                orderby c.DisplayOrder 
        //                select c;
        //    var tempResult = new PagedList<TagIntroStatuses>(query, pageIndex, pageSize);

        //    var list = tempResult.Select(c => new TagIntroStatuses()
        //    {
        //        Id = c.Id,
        //       Tag = new Tag()
        //           {
        //               Id = c.Tag.Id,
        //               CreateAt = c.Tag.CreateAt,
        //               TagName = c.Tag.TagName,
        //               TagValue = c.Tag.TagValue,
        //               CountTaged = c.Tag.CountTaged,
        //           }

        //    }).ToList();

        //    var pagedList = new PagedList<TagIntroStatuses>(list, pageIndex, pageSize, query.Count());
        //    return pagedList;
        //}
    }
}